package com.xhs.main.service.rsb.impl;

import com.xhs.main.dao.rsb.RsbUserDao;
import com.xhs.main.entity.rsb.RsbUser;
import com.xhs.main.service.rsb.RsbUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author author
 * @create 2020-10-19-20:57
 */
@Service
public class RsbUserServiceImpl implements RsbUserService {
    @Autowired
    RsbUserDao rsbUserDao;

    @Override
    public void insertRsbUser(RsbUser rsbUser) {
        rsbUserDao.insertRsbUser(rsbUser);
    }

    @Override
    public RsbUser selectRsbUserByName(String userName) {
        RsbUser rsbUser = rsbUserDao.selectRsbUserByName(userName);
        return rsbUser;
    }

    @Override
    public RsbUser selectRsbUserByNameAndNum(String userName, String userNum) {
        RsbUser rsbUser = rsbUserDao.selectRsbUserByNameAndNum(userName, userNum);
        return rsbUser;
    }

    @Override
    public void updateRsbUser(RsbUser rsbUser, String userNum, String userName) {
        rsbUserDao.updateRsbUser(rsbUser,userNum,userName);
    }


    @Override
    public List<RsbUser> selectUserByChooseLimit(RsbUser user,int page,int size) {
        List<RsbUser> rsbUsers=rsbUserDao.selectUserByChooseLimit(user,page,size);
        return rsbUsers;
    }

    @Override
    public List<RsbUser> selectUserByChoose(RsbUser user) {
        List<RsbUser> rsbUsers=rsbUserDao.selectUserByChoose(user);
        return rsbUsers;
    }

    @Override
    public int UserCount() {
        int count = rsbUserDao.UserCount();
        return count;
    }

    @Override
    public List<RsbUser> selectAllUser() {
        List<RsbUser> users = rsbUserDao.selectAllUser();
        return users;
    }

    @Override
    public void deleteUsers(List<String> nums) {
        rsbUserDao.deleteUsers(nums);
    }

    @Override
    public void deleteAll() {
        rsbUserDao.deleteAll();
    }
}
